package logic

import (
	"context"
	"order-module/order-rpc/proto/good"
	"order-module/order-service/server"
)

type GoodServer struct {
	good.UnimplementedGoodServer
}

func (g GoodServer) UserRegister(ctx context.Context, in *good.UserRegisterReq) (*good.UserRegisterResp, error) {
	register, err := server.UserRegister(in)
	if err != nil {
		return nil, err
	}
	return register, nil
}

func (g GoodServer) GoodCreate(ctx context.Context, in *good.GoodCreateReq) (*good.GoodCreateResp, error) {
	create, err := server.GoodCreate(in)
	if err != nil {
		return nil, err
	}
	return create, nil
}

func (g GoodServer) GoodList(ctx context.Context, in *good.GoodListReq) (*good.GoodListResp, error) {
	list, err := server.GoodList(in)
	if err != nil {
		return nil, err
	}
	return list, nil
}

func (g GoodServer) GoodOrder(ctx context.Context, in *good.GoodOrderReq) (*good.GoodOrderResp, error) {
	order, err := server.GoodOrder(in)
	if err != nil {
		return nil, err
	}
	return order, nil
}
